package com.zhixi.pojo;

import com.baomidou.mybatisplus.annotation.*;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

/**
 * @author zhangzhixi
 * @date 2021/2/19 19:36
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class User {
    @TableId(type = IdType.AUTO)
    private int id;
    private String name;
    private int age;
    private String email;

    @Version
    private int version;

    // 表逻辑删除
    @TableLogic
    private int deleted;

    // 自动添加策略
    @TableField(fill = FieldFill.INSERT)
    private Date createTime;
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;
}
